package admin.common;

import admin.entity.User;

/**
 * @author xf07b1
 * @wechat xf07b1
 * @description 登录上下文
 */
public class LoginContext {
    private static final ThreadLocal<User> THREAD_LOCAL = new ThreadLocal<>();

    public static User get() {
        return THREAD_LOCAL.get();
    }

    public static void set(User user) {
        THREAD_LOCAL.set(user);
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }
}
